<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>

</head>

<body>

    <!-- <a href="./a.html" id="link" onclick="function(event){alert('hello');return false;}">hello</a> -->

    <!-- <a href="./a.html" id="link" onclick="alert('hello');return false;">hello</a> -->

    <a href="./a.html" id="link" onclick="alert('hello');event.preventDefault();">hello</a>

    <script>

        // const link = document.getElementById('link');

        // link.onclick = function (e) {
        //     e.preventDefault();
        //     alert('hello');
        //     // return false;//
        //     //跳转
        // }


    </script>

</body>

</html>